package com.group12.liuxinpeng.role.repository;

import com.group12.liuxinpeng.mybatis.entity.PtRoleEntity;
import com.group12.liuxinpeng.mybatis.flexigrid.PagingBean;
import com.group12.liuxinpeng.mybatis.ztree.ZtreeEntity;
import com.group12.liuxinpeng.role.entity.SearchRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName RoleDao
 * @Description: //TODO 角色管理
 * @Author wyq
 * @Date 2022/5/16 15:22
 */
@Mapper
public interface RoleDao {
    /**
     * @Description: //TODO 查询出所有角色并实现分页查询
     * @param [search, paging]
     * @return: java.util.List<com.group12.liuxinpeng.mybatis.entity.PtRoleEntity>
     * @Author: wyq
     * @Date 2022/5/16 15:32
     */
    List<PtRoleEntity> queryRoleListPage(@Param("search") SearchRoleEntity search, @Param("paging") PagingBean paging);

    /**
     * @Description: //TODO 返回当前数据总数
     * @param [search]
     * @return: java.lang.Integer
     * @Author: wyq
     * @Date 2022/5/16 15:33
     */
    Integer queryRoleTotal(@Param("search")SearchRoleEntity search);


    /**
     * @Description: //TODO 通过角色id返回对应的菜单树
     * @param [roleUuid]
     * @return: java.util.List<java.lang.String>
     * @Author: wyq
     * @Date 2022/5/18 23:26
     */
    List<String> queryMenuIdByRoleId(@Param("roleUuid")String roleUuid);

    /**
     * @Description: //TODO 搜索出菜单的字段拼装
     * @param []
     * @return: java.util.List<com.group12.liuxinpeng.mybatis.ztree.ZtreeEntity>
     * @Author: wyq
     * @Date 2022/5/18 23:34
     */
    List<ZtreeEntity> queryMenuTree();

    /**
     * @Description: //TODO 根据角色id删除菜单
     * @param [roleUuid]
     * @return: void
     * @Author: wyq
     * @Date 2022/5/18 23:37
     */
    void deleteMenuByRoleId(@Param("roleUuid")String roleUuid);

    /**
     * @Description: //TODO 插入
     * @param [roleUuid, menuId]
     * @return: void
     * @Author: wyq
     * @Date 2022/5/18 23:44
     */
    void insertMenuAndRole(@Param("roleUuid")String roleUuid,@Param("menuId") String menuId);


}
